package com.by.entity;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Repository;

/**
 * @author LittleDesire
 * @description 切面类，只需定义好切入点，其他一切都不用改
 * @date 2022-03-22 周二 14:12
 * @since 17
 */
@Repository
@Aspect
public class Log {
    @Before("execution(public * * ..Db.*(..))")
    public void init() {
        System.out.println("连接数据库");
    }

    @After("execution(public * * ..Db.*(..))")
    public void close() {
        System.out.println("关闭数据库");
    }
}
